﻿@model MSAcademic.v2.Web.Models.Home.IndexModel

@{
    ViewBag.Title = "Naslovnica";
}

<div class="home">

    <div class="clearfix">
    @{ var count = 0;}


        <div class="featured">
            @foreach (var article in Model.FeaturedArticlesWithAuthors)
            {
                <a href="@Url.RouteUrl("ArticleProfile", new { articleId = article.Item1.Id })" class="article-item num-@count">
                    <div class="picture"><img src="@article.Item1.PictureUrlNormal" alt="@article.Item1.Title" /></div>
                    <div class="gradient-mask"></div>
                    <div class="data">
                        <h1>@article.Item1.Title</h1>
                        <span>
                            @article.Item2.FirstName @article.Item2.LastName - 
                            @article.Item1.PublishedOn.Value.ToString("dd.MM.yyyy. u HH:mm")
                        </span>
                    </div>
                    
                    @if (count == 0) { <div class="author-picture"><img src="@article.Item2.ProfilePictureUrl" alt="@article.Item2.FirstName" /></div> }

                </a>
                
                count++;
            }
        </div>
    </div>

    <hr />

    <a class="rss" href="@Url.RouteUrl("RssHome")" target="_blank">
      Pretplati se na naš RSS kanal <i class="icon-rss"></i> 
    </a>

    <hr />

    <h2>Posljednje objavljeno</h2>

    <div class="latest clearfix">
    @{ count = 0; }

    @foreach(var article in Model.LatestArticles)
    {
        <div class="item num-@count @((count == 0) ? "clearfix" : "")">
            
            <div class="picture"> 
                <a href="@Url.RouteUrl("ArticleProfile", new { articleId = article.Item1.Id })"> 
                    <img src="@article.Item1.PictureUrlNormal" alt="@article.Item1.Title" /> 
                </a>
            </div>

            <div class="data">
                <a href="@Url.RouteUrl("ArticleProfile", new { articleId = article.Item1.Id })"> 
                    <h3> @Html.Raw(article.Item1.Title)</h3>
                </a>
                <div class="meta"><a href="@Url.RouteUrl("ViewAuthorProfile", new { authorId = article.Item2.Id })">@article.Item2.FirstName @article.Item2.LastName</a> - @article.Item1.PublishedOn.Value.ToString("dd.MM.yyyy. u HH:mm")</div>
                @if (count == 0) { <p>@Html.Raw(article.Item1.ShortText)</p> }
            </div>

        </div>
        
        if (count == 0) { <hr /> }
        
        count++;
    }
    </div>

    <hr />

    <h2 class="fb">Priključi se pokretu, prati nas na Facebook-u!</h2>
    <div class="social">
        <div class="fb-like" data-href="https://www.facebook.com/msacademichr" data-send="true" data-width="1140" data-show-faces="false"></div>
        <div class="fb-facepile" data-href="https://www.facebook.com/msacademichr" data-action="like" data-max-rows="4" data-width="1140"></div>
    </div>
</div>
    
 
